package com.example.tesecond.service.impl;

import com.example.tesecond.entity.User;
import com.example.tesecond.mapper.UserMapper;
import com.example.tesecond.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public void add(String username, String content) {
        userMapper.add(username,content);
    }

    @Override
    public void delete(int id) {
        userMapper.delete(id);
    }

    @Override
    public User findById(int id) {
        return userMapper.findById(id);
    }

    @Override
    public void update(String username, String content, int id) {
        userMapper.update(username,content,id);
    }
}
